import java.io.IOException;

import obj.Obj;
import obj.ObjLoader;

public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		
		ObjLoader objLoader = new ObjLoader();

		Obj objA = new Obj();
		Obj objB = new Obj();
		
		// higher order polygons! Non-Tri polygons.
		//objLoader.load("C://Users//Wolfgang2//desktop//obj_files//sponza.obj");
		
		// tris only
		//
		// the utah teapot handle is not fully connected to the kettle body.
		// it is modelled as a separate mesh and it was moved up the the kettel body,
		// to intersect it.
		//objLoader.load("C://Users//Wolfgang2//desktop//obj_files//teapot.obj");
		
		// vertex 34 is only part of two tris!
		// vertex 34 has the exact same coordinates, than another vertex
		//
		// Even if you have watertight, fully triangulated models, if the exporter
		// stores vertices several times, you will have verteices with less than 3 triangles
		// connected to it.
		//
		// A preprocessing step might be to unify similar vertices and replace the indices! 
		// I do not know weather this breaks the obj format though
		objLoader.obj = objA;
		objLoader.load("C://Users//Wolfgang2//desktop//obj_files//wt_teapot.obj");
		
		// tris only, partially is made up of open shapes
		//
		// susannes skull is a closed mesh, whereas here eyes are just
		// open shapes that intersect here skull, so their open parts point
		// into the skull and cannot be seen from the outside
		//objLoader.load("C://Users//Wolfgang2//desktop//obj_files//suzanne.obj");
		
		// tris only, is not closed, has holes in it
		//objLoader.load("C://Users//Wolfgang2//desktop//obj_files//bunny.obj");
		
		// tris only, fully connected
		objLoader.obj = objB;
		objLoader.load("C://Users//Wolfgang2//desktop//obj_files//cube.obj");
		
		// quads, or higher level polygons:
		//objLoader.load("C://Users//Wolfgang2//desktop//obj_files//airboat.obj");
		//objLoader.load("C://Users//Wolfgang2//desktop//obj_files//al.obj");
		
		// tris only, not fully connected
		//objLoader.load("C://Users//Wolfgang2//desktop//obj_files//alfa147.obj");
		
		objA.computeAdjacency();
		objB.computeAdjacency();
		
		objA.buildBSP();
		objB.buildBSP();
		
		//tri.computeAdjacency(deque);
		
		System.out.println("ende");

	}

}
